package com.creditharmony.car.loan;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestTemplate;

/**
 * 借款工程主类
 */
@SpringBootApplication
@EnableDiscoveryClient
@ComponentScan(basePackages={"com.creditharmony.car.loan","com.creditharmony.car.common"})
public class CarLoanInfoApplication {

    /**
     * Boss网关管理端服务主方法
     * 
     * @param args 参数
     */
    public static void main(String[] args) {
        new SpringApplicationBuilder(CarLoanInfoApplication.class).web(true).run(args);
    }

    /**
     * rest服务调用
     * 
     * @return rest服务调用模板
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}